<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: zoud
  Date: 28/09/2016
  Time: 17:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Database Commons - Curator home</title>
</head>
<body>
<h2 class="ui header">Welcome, ${currentUser.lastName} ${currentUser.firstName}</h2>
<div class="sub header">Starting with your curation work</div>

<div class="ui segment">
    <h3>Profiles</h3>
    <p>Email: ${currentUser.email}</p>
    <p>Role: ${currentUser.roleList[0].name}</p>
    <a class="ui blue labeled icon button" href="${host}/user/profiles">
        Update profiles
        <i class="user icon"></i>
    </a>
    <a class="ui red labeled icon button" href="${host}/user/password">
        Reset password
        <i class="lock icon"></i>
    </a>

    <h3>Curation flow</h3>
    <div class="sub header">Four steps add a new database</div>
    <div class="ui big steps">
        <div class="step" data-tab="first">
            <i class="info icon"></i>
            <div class="content">
                <div class="title">Basic information</div>
            </div>
        </div>
        <div class="step" data-tab="second">
            <i class="tasks icon"></i>
            <div class="content">
                <div class="title">Data information</div>
            </div>
        </div>
        <div class="step" data-tab="third">
            <i class="mail icon"></i>
            <div class="content">
                <div class="title">Contact information</div>
            </div>
        </div>
        <div class="step" data-tab="fourth">
            <i class="book icon"></i>
            <div class="content">
                <div class="title">Publication information</div>
            </div>
        </div>
    </div>
    <br/>
    <a class="ui teal labeled icon button" href="${host}/curator/db/create">
        Create
        <i class="add icon"></i>
    </a>
    <a class="ui labeled icon primary button" href="${host}/curator/databases">Curate <i class="edit icon"></i></a>
    <%--<a href="${host}/curator/db/create" class="ui button medium primary">Create new database <i--%>
    <%--class="icon right edit"></i></a>--%>

    <h3 class="ui header">Curation history</h3>
    <c:if test="${fn:length(curations) eq 0}">
        <div class="ui info message">
            <p>
                You didn't curate any database!
            </p>
        </div>
    </c:if>
    <c:if test="${fn:length(curations) gt 0}">
        <table class="ui table single line">
            <thead>
            <tr>
                <th>Database ID</th>
                <th>Database name</th>
                <th>Curated date</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${curations}" var="curation">
                <tr>
                    <td><a href="${host}/curator/db/edit/${curation.biodb.dbId}">${curation.biodb.dbId}</a></td>
                    <td>${curation.biodb.shortName}</td>
                    <td><fmt:formatDate value="${curation.curationDate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </c:if>
</div>
</body>
</html>
